package pos.domain;

import java.util.List;

import pos.data.*;

public class RegaloProcessor implements IRegaloProcessor{
	
	private JDBCRegaloDAO regaloDao = new JDBCRegaloDAO();
	private static RegaloProcessor instance;
	
	public static synchronized RegaloProcessor getInstance() {
        if (instance == null)
        	instance = new RegaloProcessor();
        return instance;
    }

	@Override
	public List<Regalo> getRegalos() {
		return regaloDao.selectAllRegalos();
	}

	@Override
	public Regalo getRegalo(int idRegalo) {
		return regaloDao.selectById(idRegalo);
	}

	@Override
	public void regalar(Regalo regalo, Usuario usuario) {
		regaloDao.cajearRegalo(regalo, usuario);
	}

}
